/*
 * KKSpriteAnimation.h
 *
 *  Created on: 2013-9-15
 *      Author: wanghua
 */

#ifndef KKSPRITEANIMATION_H_
#define KKSPRITEANIMATION_H_

#include "kaka_common.h"

USING_NS_CC;

class KKSpriteFrame: public CCObject {

private:
	;CC_SYNTHESIZE(float,m_duration,Duration)
	;CC_SYNTHESIZE(string,m_image,Image)
	;

public:
	KKSpriteFrame() {
	}
	;

	virtual ~KKSpriteFrame() {
	}
	;

	static KKSpriteFrame* frameWithXml(TiXmlElement* element);

	bool initWithXml(TiXmlElement* element);
};

typedef KKMutableArray<KKSpriteFrame*> KKSpriteFrameArray;

class KKSpriteAnimation: public CCActionInterval {
private:
	;CC_SYNTHESIZE(string,m_name,Name)
	;CC_SYNTHESIZE(KKSpriteFrameArray*,m_frames,Frames)
	;
public:
	KKSpriteAnimation();
	virtual ~KKSpriteAnimation();
	virtual void update(ccTime time);

	static KKSpriteAnimation* animationWithXml(TiXmlElement* element);

	bool initWithXml(TiXmlElement* element);

};
#endif /* KKSPRITEANIMATION_H_ */
